<html>
<head>
	 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>一人一本 - 搜索结果</title>

    <!--<link href="css/bootstrap.css" rel="stylesheet">-->
	<!--<link href="css/bootstrap-responsive.min.css" rel="stylesheet">-->
	<link href="css/productlist.css" rel="stylesheet">
	<link href="css/inspiritas.css" rel="stylesheet">
	<link href="css/carousel.css" rel="stylesheet">
	<script src="js/jquery-1.7.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.form.js"></script>
    <script src="js/jquery.json-2.4.js"></script>
	<script>
	$(document).ready(	
		function()
		{
			typeListClick();

			<?php include "htm/ready.htm";?>

			$.ajax({
				url:'index.php?act=search.keywords_search&query_type=<?php echo $_GET['query_type'];?>&query=<?php echo $_GET['query'];?>',
				type:'POST',
				success:function(data){
					//alert(data);
				}
			});

			$.getJSON('index.php?act=search.keywords_search&query_type=<?php echo $_GET['query_type'];?>&query=<?php echo $_GET['query'];?>', function(data){
				var i=0;
				var html = "";
				for(var product in data)
				{
					if (i>0 && i%5==0) {
						html = html + '<div class="span1"></div></div>';
					}
					if (i%5==0) {
						html = html + '<div class="row-fluid product-row"><div class="span1"></div>';
					}
					html = html +
					'<div id="BOOK_ID_00001" class="span2 book-item">'+
					'<a href="' + 'productDetail.php?product_id=' + data[product].ID + '">'+
					'<div id="label'+i+'"></div>'+
					'<img src="'+data[product].IMAGE+'" class="img-rounded" width="160">'+
					'</a>'+
					'<div class="book-info-list">'+
					'<a href="' + 'productDetail.php?product_id=' + data[product].ID + '" class="book-name-list">'+data[product].Name+'</a>'+
					'<div id="authors">'+
					'<span class="carat juicy">›</span>'+
					'<a class="text-normal" href="#">'+data[product].Author+'</a>'+
					'</div>'+
					'<div class="smoke">平装</div>'+
					'<span class="grey book-price-old">￥&nbsp;'+data[product].Price+'</span>'+
					'<span class="red book-price-new">￥&nbsp;'+data[product].current_price+'</span>'+
					'</div>'+
					'</div>';
					i++;
				}
				if (i>0) {
					html = html+'</div>';
				}
				$('#product_list').append(html);
				var a=0;
				for(var product in data)
				{
					if(data[product].discount_type==3)
					{
					html2='<div class="absolute-label">'+
						'<img id = "" style="" src="img/团购图标.png">'+
						'</div>';
					$('#label'+a).append(html2);
					}
					a++;
				}
			}
		);
		}
	);
	
	function typeListClick()
	{
		$('#type-list').children(':not(".divider,h2")').click(function(){
			$(this).addClass('active');
			$(this).siblings().removeClass('active');
		});
	}
	</script>
</head>
<body>
<?php include "htm/head.htm";?>
<div class="row-fluid product-row">
    <div class="span1 "></div>
	
</div>

<div class="row-fluid product-row">
      <div id="product_list"></div>
</div>
 
<?php include "htm/footer.htm";?>
<?php include "htm/copyright.htm";?> 
</body>
</html>